package com.source.lightfowl.basedata.service;

import com.source.lightfowl.VO.ToMarketCurveVO;
import com.source.lightfowl.basedata.entity.ToMarket;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * @Author: cxy
 * @Description: 去向市场信息业务层接口
 */
public interface ToMarketService extends UploadExcelService {

    //查
    List<ToMarket> findAll(int state);
    List<Object> findAllDTO();
    void save(List<Object> list, HttpServletRequest request);

    //查 分页
    Page<ToMarket> findAllPage(int state, int page, int pageNum);
    //查找根据id查找
    Optional<ToMarket> findById(String id);
    //增或者改
    void save(ToMarket toMarket);
    void save(ToMarket toMarket, MultipartFile markCodeFile, MultipartFile stallCodeFile, HttpServletRequest request);
    void update(ToMarket toMarket);
    void update(ToMarket toMarket, MultipartFile markCodeFile, MultipartFile stallCodeFile, HttpServletRequest request);
    //上传图片
    String upload(MultipartFile file, HttpServletRequest request);
    //删
    void deleteById(String id);
    //批量删
    void deleteBatch(String ids);
    //按市场名字模糊查询
    List<ToMarket> findByNameLike(String name);
    //按市场档口名字模糊查询
    List<ToMarket> findByStallNameLike(String stallName);
    //按省返回所有市
    List<String> findByProvince(String province);
    //按市返回所有区
    List<String> findByCity(String province, String city);
    //按区返回去向市场
    List<ToMarket> findByDistrict(String province, String city, String district);
    //查询最近半年的档口数
//    List<Map<String,Integer>> stallsCount();
    //根据屠宰场id查询最近半年的档口数
//    List<Map<String,Integer>> stallsCount(String slaughterHouseId);
    ToMarketCurveVO stallsCount(String slaughterHouseId);

    void changeBatch(int state, String ids);
}
